<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登陆</title>
</head>
<body>
<h1>登陆</h1>
<form method="post" action="/sms/login">
    <div>
        手机号：<input type="text" id="mobile" name="mobile" value="18858745678">
    </div>
    <div>
        验证码：<input type="text" name="smsCode">
        <a href="javascript:;" onclick="sendSms()">获取验证码</a>
    </div>
    <div>
        <button type="submit">立即登陆</button>
    </div>
</form>

<script>
    function sendSms() {
        xmlHttp = new XMLHttpRequest();
        xmlHttp.open("GET", '/sms/code?mobile=' + document.getElementById("mobile").value, true);
        xmlHttp.send(null);

    }

</script>
</body>
</html>
